from blog.models import *
from blog.feeds import *

from django.conf.urls.defaults import *

urlpatterns = patterns('blog.views',
   url(r'^$', 'posty', {'glowny':False}, name='posty_wszystkie'),
   url(r'^glowny$', 'posty', {'glowny':True }, name='posty_glowny'),
   url(r'^tag/(?P<slug>[-\w]+)$', 'posty_tag', name='posty_tag'),
   url(r'^kategoria/(?P<slug>[-\w]+)$', 'posty_kategoria', name='posty_kategoria'),
   url(r'^post/dodaj/$', 'post_dodaj', name='post_dodaj'),
   url(r'^post/edytuj/(?P<id>\d+)/$', 'post_edytuj', name='post_edytuj'),
   url(r'^post/usun/(?P<id>\d+)/$', 'post_usun', name='post_usun'),
   url(r'^post/(?P<autor>[-\w]+)/(?P<rok>\d{4})/(?P<miesiac>\d{2})/(?P<slug>[-\w]+)/$', 'post', name='post'),
   url(r'^post/archiwum/$', 'posty_najstarsze',  name='posty_najstarsze'),
   url(r'^post/archiwum/(?P<year>\d{4})/(?P<month>\d{2})/$', 'posty_archiwum',  name='posty_arch'),
)

urlpatterns += patterns('',
    url(r'^rss/(?P<url>.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict': {'news': NajnowszePosty}},  name='blog_rss'),
)
